# -*- coding: utf-8 -*-
"""
Created on Mon Aug  5 18:55:53 2019

@author: Ethan
"""


database = {'account1':'001','password1':'123456','balance1':1000000,
            'account2':'002','password2':'135246','balance2':200000,
            'account3':'003','password3':'124356','balance3':3000000}

def money(database):
    if len(database)==0:
        print("there were nothing")
        return
    print("{0:<5}".format(database['balance']))
account = input("please enter your account:")
password = input("please enter your password:")

if account in database['account1'] and password in database['password1']:
    while True:
        print("="*12,"欢迎来到白日梦银行","="*12)
        print("{0:1} {1:6} {2:5}".format(" ","1.查询余额","2.取款"))
        print("{0:1} {1:5} {2:5} {3:5}".format(" ","3.转账","4.退卡","5.存款"))
        print("="*42)
        key = input("请输入选择:")
        if key =="1":
            
            print(database['balance1'])
            input("请按回车继续")
        if key =="2":
            a=int(input("请输入取款金额"))
            b=database['balance']
            c=b-a
            if b-a>0:
                print("您的余额：{}".format(c))
                print("欢迎再次光临，请取走现金")
            else:
                print("您的余额不足")
        if key =="3":
            s_a={}
            s_a['account'] = input("请输入对方账户:")
            s_a['name']= input("请输入对方名字：")
            s_a['money'] = input("请输入转账金额：")
            e = int(s_a['money'])
            c=c-e
            print(c)
            print("转账成功")
            input("按回车键继续")
        if key=="5":
            d=int(input("请输入存款金额"))
            c=c+d
            print("您的余额：{}".format(c))
        if key=="4":
            print("请取走您的银行卡")
            break
elif account in database['account2'] and password in database['password2']:
    while True:
        print("="*12,"欢迎来到白日梦银行","="*12)
        print("{0:1} {1:6} {2:5}".format(" ","1.查询余额","2.取款"))
        print("{0:1} {1:5} {2:5} {3:5}".format(" ","3.转账","4.退卡","5.存款"))
        print("="*42)
        key = input("请输入选择:")
        if key =="1":
            print(c)
            input("请按回车继续")
        if key =="2":
            a=int(input("请输入取款金额"))
            b=database['balance2']
            c=b-a
            if b-a>0:
                print("您的余额：{}".format(c))
                print("欢迎再次光临，请取走现金")
            else:
                print("您的余额不足")
        if key =="3":
            s_a={}
            s_a['account'] = input("请输入对方账户:")
            s_a['name']= input("请输入对方名字：")
            s_a['money'] = input("请输入转账金额：")
            e = int(s_a['money'])
            c=c-e
            print(c)
            print("转账成功")
            input("按回车键继续")
        if key=="5":
            d=int(input("请输入存款金额"))
            c=c+d
            print("您的余额：{}".format(c))
        if key=="4":
            print("请取走您的银行卡")
            break
            
elif account in database['account3'] and password in database['password3']:
    while True:
        print("="*12,"欢迎来到白日梦银行","="*12)
        print("{0:1} {1:6} {2:5}".format(" ","1.查询余额","2.取款"))
        print("{0:1} {1:5} {2:5} {3:5}".format(" ","3.转账","4.退卡","5.存款"))
        print("="*42)
        key = input("请输入选择:")
        if key =="1":
            print(c)
            input("请按回车继续")
        if key =="2":
            a=int(input("请输入取款金额"))
            b=database['balance3']
            c=b-a
            if b-a>0:
                print("您的余额：{}".format(c))
                print("欢迎再次光临，请取走现金")
            else:
                print("您的余额不足")
        if key =="3":
            s_a={}
            s_a['account'] = input("请输入对方账户:")
            s_a['name']= input("请输入对方名字：")
            s_a['money'] = input("请输入转账金额：")
            e = int(s_a['money'])
            c=c-e
            print(c)
            print("转账成功")
            input("按回车键继续")
        if key=="5":
            d=int(input("请输入存款金额"))
            c=c+d
            print("您的余额：{}".format(c))
        if key=="4":
            print("请取走您的银行卡")
            break        
else:
    print("your account or password are invalid")